﻿using System;
using System.Data.SqlClient;
using Devv.Core.UniDataTier;

namespace Yglu.BusinessLayer.Entities
{
	public class Store : BaseEntity
	{
		#region Properties

		public String Title { get; set; }
		public String Location { get; set; }

		#endregion

		#region Constructor

		public Store()
		{
		}

		public Store(Int32 id)
		{
			Construct(DataAccess.Store_Get(id));
		}

		#endregion

		#region Methods

		public override void Load(SqlDataReader reader)
		{
			Id = DataHandler.GetInt32(reader, "StoreId");
			Title = DataHandler.GetString(reader, "StoreTitle");
			Location = DataHandler.GetString(reader, "StoreLocation");
			Active = DataHandler.GetBoolean(reader, "StoreActive");
		}

		#endregion

		#region ToString

		public new String ToString()
		{
			return Title;
		}

		#endregion
	}
}